<template>
	<view v-if="load">

		<view>
			<uni-head :title="title"></uni-head>
			<!-- 	<button @click="start">开始</button>
		<button @click="stop">停止</button> -->
			<view class="form-body">
				<view class="form-title">
					<view class="form-title-line"></view>
					<view class="form-title-txt">方案选择</view>
				</view>
				<view class="form-title" v-if="info.select_list.length>0">
					<view class="form-label">等级方案</view>
					<view class="form-content flex-end">
						<view @tap="selectDjFanan(item.name,index,6)"
							:class="item.name == level ? 'form-btn active' : 'form-btn'"
							v-for="(item, index, key) in info.select_list" :key="'f' + key">{{ item.name }}</view>
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">保障方案</view>
					<view class="form-content flex-end">
						<view @tap="changeFangAn(key, index)"
							:class="index == fangan_name ? 'form-btn active' : 'form-btn'"
							v-for="(item, index, key) in chooseDta.fanan" :key="'f' + key">{{ index }}</view>
					</view>
				</view>
				<view v-if="info.is_third">
					<view class="form-title form-margin-top">
						<view class="form-title-line"></view>
						<view class="form-title-txt">扩展第三者责任险</view>
					</view>
					<view class="form-title-noflex">
						<view class="form-item-body">
							<view class=" form-text-grey">
								年度累计赔偿限额100万元，每次事故赔偿限额60万元，其中每次人身伤亡赔偿限额50万元，每次财产损失赔偿限额10万元。
								每次事故财产损失免赔<text v-if="info.id == 1">500</text><text v-else>1000</text>元，人伤无免赔。</view>
							<view class="form-label" @tap="changeThree">
								<image v-if="is_three"
									src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form-three-check.png"
									mode="widthFix" class="form-check-icon"></image>
								<view v-else class="form-check-no"></view>
							</view>
						</view>
						<view class="form-three">
							<view class="form-three-flex">第三者保费</view>
							<view class="form-three-right">{{this.info.third.name}}</view>
						</view>
					</view>
				</view>
				<view v-if="info.is_fire">
					<view class="form-title form-margin-top">
						<view class="form-title-line"></view>
						<view class="form-title-txt">扩展火灾爆炸责任险</view>
					</view>
					<view class="form-title-noflex">
						<view class="form-item-body">
							<view class="form-content form-text-grey">
								充电设备在投保使⽤后，在正常使⽤过程中发⽣意外事故造成三者的⼈身伤亡和财产损失依法 应由被保险⼈承担的经济赔偿责任，保险⼈负责赔偿。
								可选：扩展火灾爆炸责任。
								免赔：每次事故财产损失绝对免赔为RMB1000元或损失金额10%（以高者为准）。</view>
							<view class="form-label" @tap="changeFire">
								<image v-if="is_fire"
									src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form-three-check.png"
									mode="widthFix" class="form-check-icon"></image>
								<view v-else class="form-check-no"></view>
							</view>
						</view>
						<view class="form-three">
							<view class="form-three-flex">火灾爆炸责任保费</view>
							<view class="form-three-right">
								{{this.fangan_name ? this.info.fire[this.fangan_name].name : ''}}
							</view>
						</view>
					</view>
				</view>
				<view v-if="info.is_finished&&is_three">
					<view class="form-title form-margin-top">
						<view class="form-title-line"></view>
						<view class="form-title-txt">新机完工责任险</view>
					</view>
					<view class="form-title-noflex">
						<view class="form-item-body">
							<view class="form-content form-text-grey">
								含新机完工90天内完工责任保障;
								财产损失每次免赔200元或10%，以高者为准；
								共用第三者费任赔偿限额。
							</view>
							<view class="form-label" @tap="changeF">
								<image v-if="is_finished"
									src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form-three-check.png"
									mode="widthFix" class="form-check-icon"></image>
								<view v-else class="form-check-no"></view>
							</view>
						</view>
						<view class="form-three">
							<view class="form-three-flex">新机完工保费</view>
							<view class="form-three-right">{{info.finished.price}}元/人/年</view>
						</view>
					</view>
				</view>
				<view class="form-title form-margin-top">
					<view class="form-title-line"></view>
					<view class="form-title-txt">生效日期</view>
					<view class="form-title-txt-red">（保险期限1年）</view>
				</view>
				<view class="form-title">
					<view class="form-label">生效日期</view>
					<view class="form-content">
						<view class="form-times" @tap="dateOpen('hopeBeginTime', hopeBeginTime)">
							<text v-if="start_time">{{ start_time }}</text>
							<text v-else class="form-times-place">请选择生效日期</text>
						</view>
					</view>
					<image src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/user-menu-right.png"
						mode="widthFix" class="form-right-icon"></image>
				</view>
				<view class="form-title">
					<view class="form-label">失效日期</view>
					<view class="form-content">
						<view class="form-times">
							<text v-if="end_time">{{ end_time }}</text>
							<text v-else class="form-times-place">请选择失效日期</text>
						</view>
					</view>
					<view class="form-icon-line"></view>
				</view>
				<view class="form-title form-margin-top">
					<view class="form-title-line"></view>
					<view class="form-title-txt">营业执照</view>
				</view>
				<view class="form-title">
					<view class="form-content-block" @tap="upLoad($event, -1)">
						<view class="form-upload-box" v-if="!yyzz">
							<image src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form1.png" mode="widthFix"
								class="form-upload-icon"></image>
						</view>
						<image v-else :src="yyzz" mode="aspectFill" class="form-yyzz"></image>
						<view class="form-upload-memo">请参考示例图上传图片</view>
					</view>
					<view class="form-label">
						<image src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form2.png" mode="widthFix"
							class="form-upload-sl"></image>
						<view class="form-upload-memo form-upload-memo-grey">示例图</view>
					</view>
				</view>
				<view class="form-title form-margin-top">
					<view class="form-title-line"></view>
					<view class="form-title-txt">投保企业</view>
					<view class="form-title-flex"></view>
					<view class="form-title-right">
						<view class="uni-input" @tap="showHis()">历史信息</view>
						<!-- <picker @change="bindPickerChange" :value="his_index" :range="history" range-key="name">
						<view class="uni-input" >历史信息</view>
					</picker> -->
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">企业名称</view>
					<view class="form-content flex-end">
						<input placeholder="请输入企业名称" @blur="blurQyName()" class="form-input" v-model="qy_name"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">统一信用编码</view>
					<view class="form-content flex-end">
						<input placeholder="请输入统一信用编码" @blur="blurTyxybm()" class="form-input" v-model="tyxybm"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">经办人</view>
					<view class="form-content flex-end">
						<input placeholder="请输入经办人" @blur="storageData()" class="form-input" v-model="lxr"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">经办人手机号</view>
					<view class="form-content flex-end">
						<input placeholder="请输入经办人手机号" @blur="storageData()" class="form-input" type="number"
							maxlength="11" v-model="lxrsjh" placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<!-- <view class="form-title" >
				<view class="form-label">所在地区</view>
				<view class="form-content flex-end" @tap="selectAddrs" >
					<input placeholder="请输入所在地区" disabled class="form-input" v-model="pca" placeholder-style="color:#DDDDDD" >
				</view>
			</view> -->
				<view class="form-title">
					<view class="form-label">省市区</view>
					<view class="form-content flex-end">
						<!-- 新增省市区选择 -->
						<businessAddress :businessFrom="businessFrom" @addresChange="addresChange"></businessAddress>
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">所在地区</view>
					<view class="form-content flex-end">
						<input placeholder="请输入所在地区" @blur="storageData()" class="form-input" v-model="xxdz"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">经办人手机号批改</view>
					<view class="form-content flex-end">
						<view class="form-label" @tap="changeFour">
							<image v-if="is_manage"
								src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form-three-check.png"
								mode="widthFix" class="form-check-icon"></image>
							<view v-else class="form-check-no"></view>
						</view>
					</view>
				</view>
				<view class="" style="color: red;">
					勾选后，确认您授权给该号码持有人在投保后批改批增人员的相关权限，点击进入批改页面。
				</view>
				<view class="form-title form-margin-top" >
					<view class="form-title-line"></view>
					<view class="form-title-txt">其他共同被保企业</view>
				</view>

				<view v-for="(item, key) in open_arr" :key="'open' + key" class="bb-card">
					<!-- <view class="form-title">
          <view class="form-content-block" @tap="upLoad($event, key)">
            <view class="form-upload-box" v-if="!item.license">
              <image
                src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form1.png"
                mode="widthFix"
                class="form-upload-icon"
              ></image>
            </view>
            <image
              v-else
              :src="item.license"
              mode="aspectFill"
              class="form-yyzz"
            ></image>
            <view class="form-upload-memo">请参考示例图上传图片</view>
          </view>
          <view class="form-label">
            <image
              src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form2.png"
              mode="widthFix"
              class="form-upload-sl"
            ></image>
            <view class="form-upload-memo form-upload-memo-grey">示例图</view>
          </view>
        </view> -->
					<view class="form-title">
						<view class="form-label">企业名称</view>
						<view class="form-content flex-end">
							<input placeholder="请输入企业名称" @blur="storageData()" class="form-input" v-model="item.name"
								placeholder-style="color:#DDDDDD" />
						</view>
					</view>
					<view class="form-title">
						<view class="form-label">统一信用编码</view>
						<view class="form-content flex-end">
							<input placeholder="请输入统一信用编码" @blur="storageData()" class="form-input"
								v-model="item.client" placeholder-style="color:#DDDDDD" />
						</view>
					</view>
					<!-- <view class="form-title">
          <view class="form-label">经办人</view>
          <view class="form-content flex-end">
            <input
              placeholder="请输入经办人"
              @blur="storageData()"
              class="form-input"
              v-model="item.contact"
              placeholder-style="color:#DDDDDD"
            />
          </view>
        </view> -->
					<!-- <view class="form-title">
          <view class="form-label">经办人手机号</view>
          <view class="form-content flex-end">
            <input
              placeholder="请输入经办人手机号"
              @blur="storageData()"
              class="form-input"
              type="number"
              maxlength="11"
              v-model="item.contact_mobile"
              placeholder-style="color:#DDDDDD"
            />
          </view>
        </view> -->
					<!-- <view class="form-title">
          <view class="form-label">所在地区</view>
          <view class="form-content flex-end">
            <input
              placeholder="请输入所在地区"
              @blur="storageData()"
              class="form-input"
              v-model="item.address"
              placeholder-style="color:#DDDDDD"
            />
          </view>
        </view> -->
					<view style="display: flex;justify-content: space-around;">
						<view class="form-add-btn-delete" @tap="showHis2(key)">历史记录</view>
						<view class="form-add-btn-delete" @tap="deleteOpen(key)">删除</view>
					</view>
				</view>

				<view class="form-add-btn" @tap="addOpen()" >新增共同被保企业</view>
				<view class="" v-if="id == 9">
					<view class="form-title form-margin-top">
						<view class="form-title-line"></view>
						<view class="form-title-txt">充电桩信息</view>
						<view class="form-title-flex"></view>
					</view>
					<view class="form-title">
						<view class="form-label">地址</view>
						<view class="form-content flex-end">
							<!-- 新增省市区选择 -->
							<businessAddress :businessFrom="charge_info" @addresChange="addressChanges">
							</businessAddress>
						</view>
					</view>
					<view class="form-title">
						<view class="form-label">详细地址</view>
						<view class="form-content flex-end">
							<input placeholder="请输入详细地址" class="form-input" v-model="charge_info.address"
								placeholder-style="color:#DDDDDD" />
						</view>
					</view>
					<view class="form-title">
						<view class="form-label">充电桩数量</view>
						<view class="form-content flex-end">
							<input placeholder="充电桩数量" :disabled="true"  class="form-input" v-model="charge_info.num"
								placeholder-style="color:#DDDDDD" />
						</view>
					</view>
					<view class="form-title">
						<view class="form-label">充电桩面积</view>
						<view class="form-content flex-end">
							<input placeholder="请输入充电站面积"  class="form-input" v-model="charge_info.area_num"
								placeholder-style="color:#DDDDDD" />
						</view>
					</view>
				</view>

				<view class="" v-if="id == 9">
					<view class="form-title form-margin-top">
						<view class="form-title-line"></view>
						<view class="form-title-txt">投保充电桩清单</view>
					</view>
					<view>
						<view class=""
							style="background-color: #F6F6F6;font-size: 24rpx;display: flex;align-items: center;justify-content: space-between;padding: 0 30rpx;height: 86rpx;">
							<view class="" style="width: 52rpx;">
								序号
							</view>
							<view class="" style="width: 100rpx;">
								编号
							</view>
							<view class="" style="width: 100rpx;">
								价值
							</view>
							<view class="" style="width: 24rpx;height: 24rpx;">

							</view>
						</view>
						<view class="" v-for="(item,index) in cdzList"
							style="font-size: 24rpx;display: flex;align-items: center;justify-content: space-between;padding:15rpx 30rpx;">

							<view class="">
								{{index + 1}}
							</view>
							<view class="">
								<input placeholder="请输入" style="width: 100rpx;text-align: center;" v-model="item.no"
									placeholder-style="color:#DDDDDD" />
							</view>
							<view class="">
								<input placeholder="请输入" style="width: 100rpx;text-align: center;" v-model="item.price"
									placeholder-style="color:#DDDDDD" />
							</view>
							<image @tap="deletecdzList(index)"
								src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form3.png" mode="widthFix"
								class="form-persions-icon"></image>
						</view>

					</view>


				</view>
				<!-- 	<view v-for="(item, index) in persions" :key="'pe' + index" class="form-persons">
						<view>{{ item.name }}</view>
						<view class="form-persons-idcard">{{ item.id_card }}</view>
						<view class="form-persons-line"></view>
						<image @tap="deletePersion(index)"
							src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form3.png" mode="widthFix"
							class="form-persions-icon"></image>
					</view> -->
			</view>
			<view class="form-add-person" @tap="addcdz" v-if="id == 9">
				<image src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form4.png" mode="widthFix"
					class="form-add-p-icon"></image>
				<view class="form-add-p-txt">添加充电桩清单</view>
			</view>










			<view class="form-title form-margin-top" v-if="this.id != 9">
				<view class="form-title-line"></view>
				<view class="form-title-txt">投保人员</view>
			</view>
			<view>
				<view v-for="(item, index) in persions" :key="'pe' + index" class="form-persons">
					<view>{{ item.name }}</view>
					<view class="form-persons-idcard">{{ item.id_card }}</view>
					<view class="form-persons-line"></view>
					<image @tap="deletePersion(index)"
						src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form3.png" mode="widthFix"
						class="form-persions-icon"></image>
				</view>
			</view>
			<view class="form-add-person" @tap="addPersonModel" v-if="this.id != 9">
				<image src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form4.png" mode="widthFix"
					class="form-add-p-icon"></image>
				<view class="form-add-p-txt">添加投保人员</view>
			</view>
			<view class="form-title form-margin-top">
				<view class="form-title-line"></view>
				<view class="form-title-txt">发票信息</view>
			</view>
			<view class="form-title">
				<view class="form-label">发票类型</view>
				<view class="form-content flex-end">
					<view class="form-radio" @tap="changeFpType(2)">
						<image v-if="fp_type == 2" src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form5.png"
							mode="widthFix" class="form-radio-select"></image>
						<view v-else class="form-radio-select-no"></view>
						<view>增值税普票</view>
					</view>
					<view class="form-radio" @tap="changeFpType(1)">
						<image v-if="fp_type == 1" src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form5.png"
							mode="widthFix" class="form-radio-select"></image>
						<view v-else class="form-radio-select-no"></view>
						<view>增值税专票</view>
					</view>
				</view>
			</view>
			<view class="form-title">
				<view class="form-label">发票抬头</view>
				<view class="form-content flex-end">
					<input placeholder="请输入发票抬头" @blur="storageData()" class="form-input" v-model="fptt"
						placeholder-style="color:#DDDDDD" />
				</view>
			</view>
			<view class="form-title">
				<view class="form-label">纳税人识别号</view>
				<view class="form-content flex-end">
					<input placeholder="请输入纳税人识别号" @blur="storageData()" class="form-input" v-model="nsrsbh"
						placeholder-style="color:#DDDDDD" />
				</view>
			</view>
			<view v-if="fp_type == 1">
				<view class="form-title">
					<view class="form-label">注册地址</view>
					<view class="form-content flex-end">
						<input placeholder="请输入详细地址" @blur="storageData()" class="form-input" v-model="zcdz"
							placeholder-style="color:#DDDDDD" />
					</view>
					<!-- <view class="form-content flex-end" @tap="changeZcdz">
            <input
              placeholder="请选择省/市/区"
              disabled
              class="form-input"
              v-model="zcdz_pca"
              placeholder-style="color:#DDDDDD"
            />
          </view> -->
				</view>
				<!-- <view class="form-title">
          <view class="form-content flex-end">
            <input
              placeholder="请输入详细地址"
              @blur="storageData()"
              class="form-input"
              v-model="zcdz"
              placeholder-style="color:#DDDDDD"
            />
          </view>
        </view> -->
				<view class="form-title">
					<view class="form-label">注册电话</view>
					<view class="form-content flex-end">
						<input placeholder="请输入注册电话" @blur="storageData()" class="form-input" v-model="zcdh"
							type="number" placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">开户银行</view>
					<view class="form-content flex-end">
						<input placeholder="请输入开户银行" @blur="storageData()" class="form-input" v-model="khyh"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">开户账号</view>
					<view class="form-content flex-end">
						<input placeholder="请输入开户账号" @blur="storageData()" class="form-input" v-model="khzh"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">收件人</view>
					<view class="form-content flex-end">
						<input placeholder="请输入收件人" @blur="storageData()" class="form-input" v-model="sjr"
							placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">收件人手机号</view>
					<view class="form-content flex-end">
						<input placeholder="请输入收件人手机号" @blur="storageData()" class="form-input" v-model="sjrsjh"
							type="number" maxlength="11" placeholder-style="color:#DDDDDD" />
					</view>
				</view>
				<view class="form-title">
					<view class="form-label">收件地址</view>
					<view class="form-content flex-end">
						<input placeholder="请输入详细地址" @blur="storageData()" class="form-input" v-model="sjdz"
							placeholder-style="color:#DDDDDD" />
					</view>
					<!-- <view class="form-content flex-end" @tap="changeSjdz">
            <input
              placeholder="请选择省/市/区"
              disabled
              class="form-input"
              v-model="sjdz_pca"
              placeholder-style="color:#DDDDDD"
            />
          </view> -->
				</view>
				<view class="form-title">
					<!-- <view class="form-content flex-end">
            <input
              placeholder="请输入详细地址"
              @blur="storageData()"
              class="form-input"
              v-model="sjdz"
              placeholder-style="color:#DDDDDD"
            />
          </view> -->
				</view>
			</view>
		</view>
		<view class="footer-agree">
			<view class="form-item-body footer-agree-body">
				<view class="form-label-1" @tap="changeAgree">
					<image v-if="is_agree"
						src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/form-three-check.png" mode="widthFix"
						class="form-check-icon1 form-check-left"></image>
					<view v-else class="form-check-no1 form-check-left"></view>
				</view>
				<view class="form-content-1">
					<text>本人承诺信息真实有效，理解同意</text>
					<text @tap="toRich(1)" class="form-content-blue">《投保须知》</text>
					<text @tap="toRich(2)" class="form-content-blue">《客户告知》</text>
					<text @tap="toRich(3)" class="form-content-blue">《特别约定》</text>
					<text @tap="toRich(4)" class="form-content-blue">《责任免除》</text>
				</view>
			</view>
		</view>
		<view class="footer-agree-lines"></view>
		<view class="bx-lines"></view>
		<view class="bx-footer">
			<view class="bx-footer-left" @tap="toHome()">
				<image src="https://jy-yyzj.oss-cn-shanghai.aliyuncs.com/jdbx/h5/tohome.png" class="bx-footer-icon"
					mode="widthFix"></image>
				<view class="bx-footer-left-txt">返回首页</view>
			</view>
			<view class="bx-footer-right" @tap="submit()">立即投保</view>
		</view>
		<my-datetime ref="dateTimePop" @ok="timeOk" :shownum="3"></my-datetime>
		<addr-select ref="selectaddr" @change="selectAddrTrue"></addr-select>
		<persion-model ref="addpersons" title="添加投保人员" @change="addPersonConfirm"></persion-model>
		<!-- 注册地址 -->
		<addr-select ref="selectzcaddr" @change="selectZcdzTrue"></addr-select>
		<!-- 收件地址 -->
		<addr-select ref="selectsjaddr" @change="selectSjdzTrue"></addr-select>
		<!-- 投保企业历史信息 -->
		<view class="pick-model" v-if="visible" @tap="visible = false">
			<view class="indicatorStyle-box" @tap.stop="">
				<view class="indicatorStyle-box-head">
					<view @tap="canclS()">取消</view>
					<view class="indicatorStyle-box-head-c"></view>
					<view class="indicatorStyle-box-head-t" @tap="trueHistory">确定</view>
				</view>
				<picker-view class="indicatorStyle-box-footer" indicator-class="indicatorStyle" :value="his_value"
					@change="bindChange">
					<picker-view-column>
						<view class="indicatorStyle-box-item" v-for="(item, index) in history" :key="index">
							<view>{{ item.insure.name }}</view>
							<view class="indicatorStyle-box-item-no">{{
                item.insure.client
              }}</view>
						</view>
					</picker-view-column>
				</picker-view>
			</view>
		</view>
		<!-- 其他投保企业历史记录 -->
		<view class="pick-model" v-if="visible2" @tap="visible2 = false">
			<view class="indicatorStyle-box" @tap.stop="">
				<view class="indicatorStyle-box-head">
					<view @tap="canclS2()">取消</view>
					<view class="indicatorStyle-box-head-c"></view>
					<view class="indicatorStyle-box-head-t" @tap="trueHistory2">确定</view>
				</view>
				<picker-view class="indicatorStyle-box-footer" indicator-class="indicatorStyle" :value="his_value2"
					@change="bindChange2">
					<picker-view-column>
						<view class="indicatorStyle-box-item" v-for="(item, index) in history2" :key="index">
							<view>{{ item.name }}</view>
							<view class="indicatorStyle-box-item-no">{{
	            item.client
	          }}</view>
						</view>
					</picker-view-column>
				</picker-view>
			</view>
		</view>
	</view>



</template>

<script>
	import myDatetime from "@/components/my-datetime/my-datetime";
	import addrSelect from "@/components/address/addr.vue";
	import {
		pathToBase64,
		base64ToPath,
	} from "@/static/js_sdk/gsq-image-tools/image-tools";
	import persionModel from "@/components/persion/persion.vue";
	import uniHead from "@/components/uni-dead/head.vue";
	import businessAddress from "@/components/address/businessAddress.vue";
	import * as rrweb from "rrweb";
	var arrList = [];
	export default {
		components: {
			myDatetime,
			addrSelect,
			persionModel,
			uniHead,
			businessAddress
		},
		data() {
			return {
				businessFrom: {
					province: "",
					province_code: "",
					city: "",
					city_code: "",
					area: "",
					area_code: "",
				},
				businessFromCopy: {
					province: "",
					province_code: "",
					city: "",
					city_code: "",
					area: "",
					area_code: "",
				},
				info: {},
				load: false,
				id: 0,
				fangan_index: -1,
				fangan_name: "",
				is_three: false,
				is_finished: false,
				hopeBeginTime: "",
				dateKey: "",
				start_time: "",
				end_time: "",
				yyzz: "",
				qy_name: "",
				tyxybm: "",
				lxr: "",
				lxrsjh: "",
				xxdz: "",
				province: "",
				city: "",
				area: "",
				pca: "",
				persions: [],
				cdzList: [],
				fp_type: 2,
				fptt: "",
				nsrsbh: "",
				zcdz_province: "",
				zcdz_city: "",
				zcdz_area: "",
				zcdz_pca: "",
				zcdz: "",
				zcdh: "",
				khyh: "",
				khzh: "",
				sjr: "",
				sjrsjh: "",
				sjdz_province: "",
				sjdz_city: "",
				sjdz_area: "",
				sjdz_pca: "",
				sjdz: "",
				is_agree: false,
				his_index: 0,
				history: [],
				title: "",
				order_id: 0,
				history_arr: [],
				his_value: [0],
				visible: false,
				is_open: false,
				open_name: "",
				open_no: "",
				open_arr: [],
				typearr: ['太平洋雇主责任险·高空版', '太平洋雇主责任险·非高空版', '太平洋雇主责任险·文员版', '太平洋雇主责任险·精选版'],

				his_index2: 0,
				history2: [],
				his_value2: [0],
				visible2: false,
				open_arrChoose: null,
				chooseDta: {},
				is_manage: true,
				typeLevel: 0,
				stopFun: () => {},
				is_fire: false,
				charge_info: {
					province: "",
					city: '',
					area: '',
					address: '',
					area_num: '',
					num: '',
					province_code:'',
					city_code:'',
					area_code:''
				}
			};
		},
		onLoad(e) {
			this.id = e.id;
			console.log(this.id);
			if (e.order_id) {
				this.order_id = e.order_id;
			}
			this.getData();
			// this.title = this.typearr[this.id - 1]
			//    this.id == 1 || this.id==4 ? "太平洋雇主责任险·高空版" : "太平洋雇主责任险·非高空版";
			// this.i
			uni.setNavigationBarTitle({
				title: this.typearr[this.id - 1]
			});
			this.getHistory();
			this.getHistory2();
			this.start()
		},
		onUnload() {
			this.stopFun();
			arrList = [];
		},
		methods: {
			start() {
				console.log(arrList);
				this.stopFun = rrweb.record({
					emit(event) {
						arrList.push(event);
					}
				})
			},
			// stop() {
			// 	this.stopFun();
			// 	console.log(JSON.stringify(arrList));
			// },
			addresChange(e) {
				let data = JSON.parse(e)
				if (data.logo == 1) {
					this.businessFrom = JSON.parse(JSON.stringify(this.businessFromCopy))
					this.businessFrom.province = data.value[0].label
					this.businessFrom.province_code = data.value[0].value
				} else if (data.logo == 2) {
					this.businessFrom.city = data.value[0].label
					this.businessFrom.city_code = data.value[0].value
					this.businessFrom.area = ""
					this.businessFrom.area_code = ""
				} else {
					this.businessFrom.area = data.value[0].label
					this.businessFrom.area_code = data.value[0].value
				}
				this.storageData();
				this.$forceUpdate()
			},
			//充电桩地址
			addressChanges(e){
				let data = JSON.parse(e)
				if (data.logo == 1) {
					// this.businessFrom = JSON.parse(JSON.stringify(this.businessFromCopy))
					this.charge_info.province = data.value[0].label
 
					this.charge_info.province_code = data.value[0].value
				} else if (data.logo == 2) {
					this.charge_info.city = data.value[0].label
					this.charge_info.city_code = data.value[0].value
					this.charge_info.area = ""
					this.charge_info.area_code = ""
				} else {
					this.charge_info.area = data.value[0].label
					this.charge_info.area_code = data.value[0].value
				}
				this.storageData();
				this.$forceUpdate()
			},
			changeFour() {
				this.is_manage = !this.is_manage;
				this.storageData();
			},
			deleteOpen(index) {
				this.open_arr.splice(index, 1);
				this.storageData();
			},
			addOpen() {
				this.open_arr.push({
					name: "",
					client: "",
					contact: "",
					contact_mobile: "",
					address: "",
					license: "",
				});
				this.storageData();
			},
			changeOpen(e) {
				this.is_open = e.detail.value;
				this.open_name = "";
				this.open_no = "";
			},
			canclS() {
				this.visible = false;
			},
			canclS2() {
				this.visible2 = false;
			},
			showHis() {
				this.his_index = 0;
				this.visible = true;
			},
			showHis2(index) {
				this.open_arrChoose = index
				this.his_index2 = 0;
				this.visible2 = true;
			},
			bindChange(e) {
				this.his_index = e.detail.value[0];
			},
			bindChange2(e) {
				this.his_index2 = e.detail.value[0];
			},
			trueHistory() {
				var info = {
					detail: {
						value: this.his_index,
					},
				};
				this.bindPickerChange(info);
				this.visible = false;
			},
			trueHistory2() {
				this.open_arr[this.open_arrChoose] = this.history2[this.his_index2];
				this.storageData();
				this.visible2 = false;
			},
			getInfo() {
				uni.showLoading({
					title: "加载中",
				});
				this.ajax("user/orderInfo", {
					data: {
						id: this.order_id,
					},
					success: (res) => {
						uni.hideLoading();
						this.load = true;
						this.toFormData(res.msg);
					},
				});
			},
			toRich(type) {
				// if (type == 3) {
				// 	if (this.id == 1 && !this.is_three) type = 9;
				// 	if (this.id == 2 && this.is_three) type = 10;
				// 	if (this.id == 2 && !this.is_three) type = 11;
				// }
 
				//id is_three level 完工
				this.is_three ? this.is_three = 1 : this.is_three = 0;
				this.is_finished ? this.is_finished = 1 : this.is_finished = 0;
				this.is_fire ? this.is_fire = 1 : this.is_fire = 0;
				uni.navigateTo({
					//url: "/pages/index/rich?type=" + type,
					url: `/pages/index/rich?is_third=${this.is_three}&id=${this.id}&level=${this.level}&is_finished=${this.is_finished}&type=${type}&is_fire=${this.is_fire}`
				});
			},
			blurQyName() {
				this.fptt = this.qy_name;
				this.storageData();
			},
			blurTyxybm() {
				this.nsrsbh = this.tyxybm;
				this.storageData();
			},
			//缓存数据
			storageData() {
				var data = {
					is_manage: this.is_manage,
					level: this.level,
					bx_id: this.id,
					fanan: this.fangan_name,
					// fangan_index: this.fangan_index,
					start_time: this.start_time,
					end_time: this.end_time,
					is_third: this.is_three,
					is_finished: this.is_finished,
					is_open: this.is_open,
					open_no: this.open_no,
					open_name: this.open_name,
					insure: {
						name: this.qy_name,
						client: this.tyxybm,
						// province: this.province,
						// city: this.city,
						// area: this.area,
						//新增的地址
						province: this.businessFrom.province,
						city: this.businessFrom.city,
						area: this.businessFrom.area,
						address: this.xxdz,
						contact: this.lxr,
						contact_mobile: this.lxrsjh,
						license: this.yyzz,
					},
					invoice: {
						invoice_type: this.fp_type,
						invoice_name: this.fptt,
						invoice_no: this.nsrsbh,
						invoice_mobile: this.zcdh,
						invoice_bank: this.khyh,
						invoice_bank_no: this.khzh,
						invoice_province: this.zcdz_province,
						invoice_city: this.zcdz_city,
						invoice_area: this.zcdz_area,
						invoice_address: this.zcdz,
						name: this.sjr,
						mobile: this.sjrsjh,
						province: this.sjdz_province,
						city: this.sjdz_city,
						area: this.sjdz_area,
						address: this.sjdz,
					},
					user: this.persions,
					open_arr: this.open_arr,
					mark:arrList
				};
				this.ajax("home/saveOrder", {
					data: data,
					success: (res) => {},
				});
			},

			//获取缓数据
			getStorage() {
				this.ajax("home/getSave", {
					data: {
						bx_id: this.id,
					},
					success: (res) => {
						if (res.msg != false) {
							var data = res.msg;
							uni.showModal({
								title: "提示",
								content: "发现未完成的订单，是否继续填写",
								cancelText: "重新填写",
								confirmText: "继续填写",
								confirmColor: "#2B6FF6",
								success: (res) => {
									if (res.confirm) {
										this.toFormData(data);
									} else if (res.cancel) {}
								},
							});
						}
						// console.log(res);
					},
				});
			},

			//填充数据
			toFormData(data) {
				console.log(data);
				console.log("=============");
				this.id = data.bx_id;
				this.fangan_name = data.fanan;
				this.level = data.level
				this.is_manage = data.is_manage
				this.is_fire = data.is_fire;
				if(this.id == 9){
					this.charge_info = data.charge_info;
				}
				this.cdzList = data.stake;
				if(data.mark == 'undefined'){
						arrList = data.mark;
				}
			
				console.log(data.mark);
				if (this.level) {
					this.selectDjFanan(this.level)
				}
				// this.fangan_index = data.fangan_index;
				// Object.getOwnPropertyNames(this.info.fanan).forEach((key, index) => {
				// 	if (this.fangan_name == key) {
				// 		if (this.fangan_index == undefined || this.fangan_index < 0)
				// 			this.fangan_index = index;
				// 	}
				// });
				this.start_time = data.start_time;
				if (uni.getSystemInfoSync().platform == "ios") {
					this.start_time = this.start_time.replace(/-/g, "/");
				}
				this.end_time = data.end_time;
				if (uni.getSystemInfoSync().platform == "ios") {
					this.end_time = this.end_time.replace(/-/g, "/");
				}
				this.is_three = data.is_third;
				this.is_finished = data.is_finished
				this.qy_name = data.insure.name;
				this.tyxybm = data.insure.client;
				//新地址
				this.businessFrom.province = data.insure.province;
				this.businessFrom.city = data.insure.city;
				this.businessFrom.area = data.insure.area;
				// this.province = data.insure.province;
				// this.city = data.insure.city;
				// this.area = data.insure.area;
				this.pca = this.province + this.city + this.area;
				this.xxdz = data.insure.address;
				this.lxr = data.insure.contact;
				this.lxrsjh = data.insure.contact_mobile;
				this.yyzz = data.insure.license;
				//发票信息
				this.fp_type = data.invoice.invoice_type;
				this.fptt = data.invoice.invoice_name;
				this.nsrsbh = data.invoice.invoice_no;
				this.zcdh = data.invoice.invoice_mobile;
				this.khyh = data.invoice.invoice_bank;
				this.khzh = data.invoice.invoice_bank_no;
				this.zcdz_province = data.invoice.invoice_province;
				this.zcdz_city = data.invoice.invoice_city;
				this.zcdz_area = data.invoice.invoice_area;
				this.zcdz_pca = this.zcdz_province + this.zcdz_city + this.zcdz_area;
				this.zcdz = data.invoice.invoice_address;
				this.sjr = data.invoice.name;
				this.sjrsjh = data.invoice.mobile;
				this.sjdz_province = data.invoice.province;
				this.sjdz_city = data.invoice.city;
				this.sjdz_area = data.invoice.area;
				this.sjdz_pca = this.sjdz_province + this.sjdz_city + this.sjdz_area;
				this.sjdz = data.invoice.address;
				this.persions = data.user;
				this.is_open = data.is_open;
				this.open_name = data.open_name;
				this.open_no = data.open_no;
				this.open_arr = data.open_arr ? data.open_arr : [];
			},

			//历史信息
			bindPickerChange(e) {
				// console.log(e);
				this.his_index = e.detail.value;
				var data = this.history[this.his_index];
				this.is_manage = data.is_manage
				this.qy_name = data.insure.name;
				this.tyxybm = data.insure.client;
				this.yyzz = data.insure.license;
				this.lxr = data.insure.contact;
				this.lxrsjh = data.insure.contact_mobile;
				this.xxdz = data.insure.address;
				//新地址
				this.businessFrom.province = data.insure.province;
				this.businessFrom.city = data.insure.city;
				this.businessFrom.area = data.insure.area;
				// this.province = data.insure.province;
				// this.city = data.insure.city;
				// this.area = data.insure.area;
				this.pca = this.province + this.city + this.area;
				//发票信息
				this.fp_type = data.invoice.invoice_type;
				this.fptt = data.invoice.invoice_name;
				this.nsrsbh = data.invoice.invoice_no;
				this.zcdz_province = data.invoice.invoice_province;
				this.zcdz_city = data.invoice.invoice_city;
				this.zcdz_area = data.invoice.invoice_area;
				this.zcdz_pca = this.zcdz_province + this.zcdz_city + this.zcdz_area;
				this.zcdz = data.invoice.invoice_address;
				this.zcdh = data.invoice.invoice_mobile;
				this.khyh = data.invoice.invoice_bank;
				this.khzh = data.invoice.invoice_bank_no;
				this.sjr = data.invoice.name;
				this.sjrsjh = data.invoice.mobile;
				this.sjdz_province = data.invoice.province;
				this.sjdz_city = data.invoice.city;
				this.sjdz_area = data.invoice.area;
				this.sjdz_pca = this.sjdz_province + this.sjdz_city + this.sjdz_area;
				this.sjdz = data.invoice.address;
				this.is_open = data.is_open;
				this.open_name = data.open_name;
				this.open_no = data.open_no;
				this.storageData();
			},
			//历史数据
			getHistory() {
				this.ajax("home/getClient", {
					success: (res) => {
						this.history = res.msg;
						this.history_arr = [this.history];
						console.log(this.history);
					},
				});
			},
			//历史记录
			getHistory2() {
				this.ajax("index/getClientList", {
					success: (res) => {
						this.history2 = res.msg;
					},
				});
			},
			//提交数据
			submit() {
				console.log(this.fangan_name);
				if (!this.is_agree) return this.toast("请先阅读并同意协议");
				if (!this.fangan_name) return this.toast("请选择方案");
				if (!this.start_time) return this.toast("请选择生效时间");
				if (!this.qy_name) return this.toast("请输入企业名称");
				if (!this.tyxybm) return this.toast("请输入统一信用编码");
				if (!this.lxr) return this.toast("请输入经办人");
				if (!this.lxrsjh) return this.toast("请输入经办人手机号");
				// if(!this.pca)return this.toast('请选择所在地区');
				if (!this.xxdz) return this.toast("请输入详细地址");
				if (!this.yyzz) return this.toast("请先上传营业执照");
				
				if(this.id != 9){
					if (this.persions.length == 0) return this.toast("请添加投保人员");
				}
				if (!this.fptt) return this.toast("请输入发票抬头");
				if (!this.nsrsbh) return this.toast("请输入纳税人编号");
				if (this.fp_type == 1) {
					// if (!this.zcdz_pca) return this.toast("请选择注册地址");
					if (!this.zcdz) return this.toast("请输入详细注册地址");
					if (!this.zcdh) return this.toast("请输入注册电话");
					if (!this.khyh) return this.toast("请输入开户银行");
					if (!this.khzh) return this.toast("请输入开户账号");
					if (!this.sjr) return this.toast("请输入收件人");
					if (!this.sjrsjh) return this.toast("请输入收件人手机号");
					// if (!this.sjdz_pca) return this.toast("请选择收件地址");
					if (!this.sjdz) return this.toast("请输入详细收件地址");
				}
				
				if(this.info.id == 9){
					if(!this.charge_info.address || !this.charge_info.province || !this.charge_info.city || !this.charge_info.area){
					return this.toast('请输入地址')
				}
				if(!this.charge_info.area_num){
					return this.toast('请输入充电桩面积')
				}
				if(!this.charge_info.num){
					return this.toast('请输入充电桩数量')
				}
				}
				
				/* if(this.is_open) {
					if(!this.open_name)return this.toast('请输入企业名称');
					if(!this.open_no)return this.toast('请输入统一信用编码');
					var open_name_arr = this.open_name.split('、');
					var open_no_arr = this.open_no.split('、');
					if(open_name_arr.length != open_no_arr.length)return this.toast('请完善被保企业名称或统一信用编码');
				} */
				for (var x in this.open_arr) {
					if (!this.open_arr[x].name) return this.toast("请输入企业名称");
					if (!this.open_arr[x].client) return this.toast("请输入统一信用编码");
					// if (!this.open_arr[x].contact) return this.toast("请输入经办人");
					// if (!this.open_arr[x].contact_mobile)
					//   return this.toast("请输入经办人手机号");
					// if (!this.open_arr[x].address) return this.toast("请输入所属地区");
				}
				var data = {
					mark: arrList,
					bx_id: this.id,
					stake: this.cdzList,
					charge_info:this.charge_info,
					level: this.level,
					fanan: this.fangan_name,
					start_time: this.start_time,
					end_time: this.end_time,
					is_third: this.is_three,
					is_finished: this.is_finished,
					is_open: this.is_open,
					open_no: this.open_no,
					open_name: this.open_name,
					is_manage: this.is_manage,
					is_fire:this.is_fire,
					insure: {
						name: this.qy_name,
						client: this.tyxybm,
						//新地址
						province: this.businessFrom.province,
						city: this.businessFrom.city,
						area: this.businessFrom.area,
						// province: this.province,
						// city: this.city,
						// area: this.area,
						address: this.xxdz,
						contact: this.lxr,
						contact_mobile: this.lxrsjh,
						license: this.yyzz,
						is_manage: this.is_manage
					},
					invoice: {
						invoice_type: this.fp_type,
						invoice_name: this.fptt,
						invoice_no: this.nsrsbh,
						invoice_mobile: this.zcdh,
						invoice_bank: this.khyh,
						invoice_bank_no: this.khzh,
						invoice_province: this.zcdz_province,
						invoice_city: this.zcdz_city,
						invoice_area: this.zcdz_area,
						invoice_address: this.zcdz,
						name: this.sjr,
						mobile: this.sjrsjh,
						province: this.sjdz_province,
						city: this.sjdz_city,
						area: this.sjdz_area,
						address: this.sjdz,
					},
					user: this.persions,
					open_arr: this.open_arr,
				};
				if (this.order_id) data.id = this.order_id;
				console.log(data);
				uni.showLoading({
					title: "数据提交中",
					mask: true,
				});
				this.stopFun();
				this.ajax("home/addOrder", {
					data: data,
					success: (res) => {
						uni.hideLoading();

						if (res.code) {
							this.toast("提交成功");
							this.storageData();
							setTimeout(() => {
								uni.redirectTo({
									url: "/pages/bx/confirm?id=" + res.msg,
								});
							}, 1000);
						} else {
							this.toast(res.msg);
						}
					},
				});
			},
			toHome() {
				uni.switchTab({
					url: "/pages/index/index",
				});
			},
			changeAgree() {
				this.is_agree = !this.is_agree;
			},
			//选择收件地址
			changeSjdz() {
				this.$refs["selectsjaddr"].open();
			},
			selectSjdzTrue(e) {
				this.sjdz_province = e[0];
				this.sjdz_city = e[1];
				this.sjdz_area = e[2];
				this.sjdz_pca = e[0] + e[1] + e[2];
				this.storageData();
			},
			//选择注册地址
			changeZcdz() {
				this.$refs["selectzcaddr"].open();
			},
			selectZcdzTrue(e) {
				this.zcdz_province = e[0];
				this.zcdz_city = e[1];
				this.zcdz_area = e[2];
				this.zcdz_pca = e[0] + e[1] + e[2];
				this.storageData();
			},
			//切换发票类型
			changeFpType(type) {
				this.fp_type = type;
				this.storageData();
			},
			//添加投保人
			addPersonModel() {
				this.$refs["addpersons"].show = true;
			},
			addPersonConfirm(e) {
				for (var i in this.persions) {
					if (this.persions[i].id_card == e.id_card) {
						return this.toast("该用户已存在");
					}
				}
				this.persions.push(e);
				this.storageData();
			},
			//删除投保人员
			deletePersion(index) {
				this.persions.splice(index, 1);
				this.storageData();
			},
			//删除充电桩
			deletecdzList(index) {
				this.cdzList.splice(index, 1);
				this.storageData();
				this.charge_info.num = this.cdzList.length;
			},
			//选择地址
			selectAddrs() {
				this.$refs["selectaddr"].open();
			},
			selectAddrTrue(e) {
				this.province = e[0];
				this.city = e[1];
				this.area = e[2];
				this.pca = e[0] + e[1] + e[2];
				this.storageData();
			},
			//上传图片
			upLoad(e, index) {
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ["original", "compressed"], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ["album", "camera "], //从相册选择
					success: (res) => {
						var pic = res.tempFilePaths[0];
						pathToBase64(res.tempFilePaths[0])
							.then((base64) => {
								// 获取图片信息

								let timestamp = new Date().getTime();
								uni.showLoading({
									title: "图片上传中",
								});
								this.oss_upload({
									tempFilePaths: [pic]
								}, timestamp, {
									success: (res) => {
										var src =
											"https://djb.oss-cn-shanghai.aliyuncs.com/" +
											timestamp;
										if (index == -1) {
											this.yyzz = src;
										} else {
											this.open_arr[index].license = src;
										}
										this.ajax("home/getFace", {
											data: {
												url: src,
											},
											success: (res) => {
												if (index == -1) {
													this.qy_name = res.msg.name;
													this.tyxybm = res.msg.client;
													this.lxr = res.msg
														.legal_person;
													this.xxdz = res.msg.address;
													this.fptt = res.msg.name;
													this.nsrsbh = res.msg.client;
												} else {
													this.open_arr[index].name = res
														.msg.name;
													this.open_arr[index].client =
														res.msg.client;
													this.open_arr[index].contact =
														res.msg.legal_person;
													this.open_arr[index].address =
														res.msg.address;
												}
												this.storageData();
												console.log(res);
											},
										});

										this.storageData();
										uni.hideLoading();
									},
									fail: (ress) => {
										uni.hideLoading();
										this.toast("图片上传失败");
									},
								});

							})
							.catch((error) => {
								this.toast("图片解析失败");
							});
					},
				});
			},
			//选择开始日期
			timeOk(e) {
				var start_time = e + " 00:00:00";
				var timestamp = Date.parse(new Date());
				var starttime = this.getTargetTime(start_time);
				if (starttime < timestamp) return this.toast("生效时间不能小于当前时间");
				this.start_time = e + " 00:00:00";
				if (uni.getSystemInfoSync().platform == "ios") {
					this.start_time = this.start_time.replace(/-/g, "/");
				}

				var d2 = new Date(this.start_time);
				d2.setFullYear(d2.getFullYear() + 1);
				d2.setDate(d2.getDate());
				var year = d2.getFullYear();
				var month = d2.getMonth() + 1;
				month = month < 10 ? "0" + month : month;
				var day = d2.getDate();
				day = day < 10 ? "0" + day : day;
				var hour = d2.getHours();
				hour = hour < 10 ? "0" + hour : hour;
				var minut = d2.getMinutes();
				minut = minut < 10 ? "0" + minut : minut;
				var second = d2.getSeconds();
				second = second < 10 ? "0" + second : second;
				var date = year + "-" + month + "-" + day;
				this.end_time = date + " 00:00:00";
				if (uni.getSystemInfoSync().platform == "ios") {
					this.end_time = this.end_time.replace(/-/g, "/");
				}
				this.storageData();
			},
			getTargetTime(t) {
				var d = t.split(" ")[0],
					h = t.split(" ")[1],
					date = new Date();

				date.setYear(d.split("-")[0]);
				date.setMonth(d.split("-")[1] - 1);
				date.setDate(d.split("-")[2]);

				date.setHours(h.split(":")[0]);
				date.setMinutes(h.split(":")[1]);
				date.setSeconds(h.split(":")[2]);

				return date.getTime();
			},
			//添加充电桩
			addcdz() {
				let param = {
					no: '',
					price: ''
				}
				this.cdzList.push(param);
				this.charge_info.num = this.cdzList.length;
			},
			// 开启弹窗
			dateOpen(key, date) {
				this.dateKey = key;
				this.$refs.dateTimePop.open(date || "");
			},
			//选择第三者保险
			changeThree() {
				if (this.info.third_true) {
					this.is_three = true
				} else {
					this.is_three = !this.is_three;
				}
				this.storageData();
			},
			changeFire() {

				if (this.info.fire_true) {
					this.is_fire = true
				} else {
					this.is_fire = !this.is_fire;
				}
				this.storageData();
			},
			//新机完工责任险
			changeF() {
				if (this.info.finished_true) {
					this.is_finished = true
				} else {
					this.is_finished = !this.is_finished;
				}
				this.storageData();
			},
			//改变方案
			changeFangAn(index, name) {
				console.log(index);
				console.log(name);
				// this.fangan_index = index;
				this.fangan_name = name;
				this.storageData();
			},
			selectDjFanan(itemN, index, logo) {
				this.level = itemN;
				if (logo) {
					this.fangan_name = ""
					// this.fangan_index = -1;
					this.chooseDta = this.info[this.info.select_list[index].value]
				} else {
					let findName = ""
					this.info.select_list.forEach(item => {
						if (item.name === itemN) {
							return findName = item.value
						}
					})
					this.chooseDta = this.info[findName]
				}
				this.storageData();
				this.$forceUpdate();
			},
			getData() {
				uni.showLoading({
					title: "加载中",
				});
				this.ajax("index/detail", {
					data: {
						id: this.id,
					},
					success: (res) => {
						this.info = res.msg;
						this.typeLevel = res.msg.type;
						if (this.info.third_true) {
							this.is_three = true
						}

						if (this.info.finished_true) {
							this.is_finished = true
						}

						if (this.info.select_list.length == 0) {
							this.chooseDta.fanan = this.info.fanan
							this.chooseDta.fananlist = this.info.fananlist
						} else {
							this.level = this.info.select_list[0].name
							this.chooseDta = this.info[this.info.select_list[0].value]
						}
						this.title = this.info.name
						uni.hideLoading();
						this.load = true;
						if (!this.order_id) this.getStorage();
						else this.getInfo();
					},
				});
			},
		},
	};
</script>

<style>
	@import url("@/static/css/box/index.css");
	@import url("@/static/css/box/form.css");
</style>